export function useStorage() {
  const getStorage = <T>(key: string): T | null => {
    const value = uni.getStorageSync(key)
    return value || null
  }

  const setStorage = <T>(key: string, value: T) => {
    uni.setStorageSync(key, value)
  }

  const removeStorage = (key: string) => {
    uni.removeStorageSync(key)
  }

  const clearStorage = () => {
    uni.clearStorageSync()
  }

  return { getStorage, setStorage, removeStorage, clearStorage }
}